package me.haoliang.akkaDemo

import akka.actor.Actor

/**
  * author: planck 
  * createTime: 2016/11/3.
  */
case class ProcessStringMsg(string: String)

case class StringProcessedMsg(words: Int)

class StringCounterActor extends Actor {
  override def receive: Receive = {
    case ProcessStringMsg(string) => {
      val wordsInLine = string.split(" ").length
      sender ! StringProcessedMsg(wordsInLine)
    }
  }
}
